#ifndef M_RAY_TRACER
#define M_RAY_TRACER
#include"../media/medium.h"
#include"../scene/scene.h"
#include"../light/light.h"

#include"../material/material.h"

enum IntegrationType{RT_PT,RT_PPM,RT_SPPM};

//Monte Carlo integration algorithm
class RayTracer
{
protected:
	Camera * cam;
	Scene * scene;
	IntegrationType integration_type;
	const bool enableMedia; //whether ray tracing enables media. False by default.
public:
	void set_scene(Scene* _scene);
	void set_camera(Camera* _cam);
	RayTracer(IntegrationType integration_type, bool enableMedia = false);
	IntegrationType get_tracer_type();
	Spectrum sampleDirectLighting(SurfaceInteraction *si, shared_ptr<BSDF> bsdf,Ray &ray,Light* light,RandGenerator *randGen,bool isInMedia=false,bool processSpecular =false);
	virtual void render(string outputname, string config) = 0;
};


#endif // !M_RAY_TRACER
